package com.cskaoyan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 请求方法限定
 */
@Controller
@RequestMapping("method")
public class RequestMethodLimitController {

    //@RequestMapping(value = "get",method = RequestMethod.GET)
    @GetMapping("get")
    @ResponseBody
    public String get() {
        return "method GET";
    }
    //@RequestMapping(value = "post",method = RequestMethod.POST)
    @PostMapping("post")
    @ResponseBody
    public String post() {
        return "method POST";
    }

    @ResponseBody
    @RequestMapping(value = "double",method = {RequestMethod.GET,RequestMethod.POST})
    public String doubleMethod() {
        return "method GET or POST";
    }
}
